////////////////////////////////////////////////////////////////////////////////
//
//  FLYING KIWI BV
//  Copyright 2010 Flying Kiwi BV
//  All Rights Reserved.
//
//  NOTICE: Flying Kiwi permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
package plantool.modules.workplaces.display {
	//--------------------------------------------------------------------------
	//  Imports
	//--------------------------------------------------------------------------
	import plantool.modules.users.UserApi;
	import plantool.core.CoreDisplayObject;
	import plantool.modules.workplaces.data.Workplace;
	
	//--------------------------------------------------------------------------
	//  [Metadata (Events, Style, Effects etc)]
	//--------------------------------------------------------------------------
	
	//--------------------------------------------------------------------------
	//  Class declaration
	//--------------------------------------------------------------------------
	public class WorkplaceDisplayObject extends CoreDisplayObject implements IWorkplaceDisplayObject {
		//--------------------------------------------------------------------------
		//Class constants
		//--------------------------------------------------------------------------
		
		//--------------------------------------------------------------------------
		//Class variables
		//--------------------------------------------------------------------------
		private var _workplace:Workplace		= null;
		
		//--------------------------------------------------------------------------
		//Class properties
		//--------------------------------------------------------------------------
		public function get workplace():Workplace {
			return _workplace;
		}
		public function set workplace(value:Workplace):void {
			//check if a new user is set
			if (value != _workplace) {
				//store new user
				_workplace = value;
				
				//invalidate
				invalidate();
			}
		}
		
		//--------------------------------------------------------------------------
		//Constructor and Destructor
		//--------------------------------------------------------------------------
		public function WorkplaceDisplayObject() {
			super();
		}
		
		public override function dispose():void {
			//unset user
			_workplace = null;
			
			//call super dispose
			super.dispose();
		}
		
		//--------------------------------------------------------------------------
		//Class methods
		//--------------------------------------------------------------------------
	}
}